package com.itheima.dao;


import com.itheima.domain.Role;
import com.itheima.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {

    //@Select("select * from users")
     List<User> findAll();

    //@Insert("insert into users values(#{id},#{email},#{username},#{password},#{phoneNum},#{status})")
    void addUser(User user);

    void deleteUser(String[] ids);

    //@Select("select * from users where username like concat('%',#{username},'%')")
    List<User> search(String username);

    //@Select("select * from users where id = #{id}")
    User findById(@Param("id") String id);
    //@Update("update users set status=#{status} where id=#{id}")
    void updateStatus(@Param("id") String id, @Param("status") int status);

    List<Role> findAllRoleByUserId(String id);

    void deleteRole(String userId);

    void updateRole(@Param("userId") String userId, @Param("id") String id);

    List<Role> findRoleByUserId(String id);
}
